package com.cmz.common.dto;

import com.cmz.common.api.dto.StandardOrderInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.util.List;


/**
 * 通用分页请求
 * @param <T> 查询条件类型
 * @author cmz
 */
@Getter
@Setter
@ApiModel("通用分页请求")
public class GridRequest<T> extends Request<com.cmz.common.dto.GridRequest.GridSearch<T>> {

    /** 查询条件 */
    @ApiModelProperty(name = "data", value = "分页请求数据")
    private GridSearch<T> data = new GridSearch<>();

    /**
     * 分页请求数据
     * @param <T> 查询条件类型
     */
    @Getter
    @Setter
    @ApiModel("分页请求数据")
    public static class GridSearch<T> {

        /** 查询条件 */
        @ApiModelProperty(name = "searchParam", value = "查询条件")
        private T searchParam;

        /** 分页条件 */
        @ApiModelProperty(name = "page", value = "分页条件")
        private Pagination page;

        /** 排序条件 */
        @ApiModelProperty(name = "orders", value = "排序条件")
        private List<StandardOrderInfo> orders;

    }

}
